//
//  MainCollectionViewCell.m
//  XiangMu_ManHua
//
//  Created by dllo on 15/10/28.
//  Copyright © 2015年 蓝鸥科技. All rights reserved.
//

#import "MainCollectionViewCell.h"

@implementation MainCollectionViewCell
- (instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        
        
        self.myimageview = [[UIImageView alloc] init];
        [self.contentView addSubview:self.myimageview];
        self.myimageview.backgroundColor = [UIColor yellowColor];
        
        self.mylabel = [[GrayLabel alloc] init];
        [self.contentView addSubview:self.mylabel];
        self.mylabel.textAlignment = NSTextAlignmentCenter;
        self.mylabel.font = [UIFont systemFontOfSize:14];
//        self.mylabel.textColor = [UIColor grayColor];
        self.contentView.layer.borderWidth = 0.5f;
        
    }
    return self;
    
}

- (void)applyLayoutAttributes:(UICollectionViewLayoutAttributes *)layoutAttributes

{
     self.backgroundColor = [UIColor clearColor];
    self.myimageview.frame = CGRectMake(0, 0 , cellWidth, cellHeight - 30);
    self.mylabel.frame = CGRectMake(0, cellHeight-30, cellWidth, 30);
    if ([[NSUserDefaults standardUserDefaults]boolForKey:@"nightstyle"]) {
        _mylabel.textColor = [UIColor whiteColor];
    }else{
        _mylabel.textColor = [UIColor grayColor];
    }
    
}





@end
